import java.util.*;

public class Test1 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4};
        arr = Arrays.copyOf(arr, arr.length + 2);
        System.out.println(arr);

//        minCostClimbingStairs(new int[]{2,5,3,1});
    }
    public static int minCostClimbingStairs (int[] cost) {
        // write code here
        int n = cost.length;
        if(n == 1) return cost[0];

//        Collection
//        Set
//        List
//        Queue
//        LinkedList
//        ArrayList

//        Map
//        Stack
//        Vector


        int[] dp = new int[n + 1];
        dp[1] = 0;
        for(int i = 2; i <= n; i++) {
            dp[i] = Math.min(dp[i - 1] + cost[i - 1], dp[i - 2] + cost[i - 2]);
        }
        return dp[n];
    }
}
